package com.lmf.recursion;

/**
 * 阶乘：利用递归方法
 */
public class Factorial {
    public static void main(String[] args) {
        int i = factorialCal(5);
        System.out.println(i);
    }
    public static int factorialCal(int num){
        int res = 1;
        if (num != 1) {
            res = num * factorialCal(num-1);
            return res;
        }
        return res;
    }
}
